Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement docker configuration for mita #167

Merged
merged 3 commits into from
Oct 28, 2024
Merged

Conversation

mxyhi
Copy link
Contributor

@mxyhi mxyhi commented Oct 26, 2024

No description provided.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can follow the project layout from https://github.com/golang-standards/project-layout/tree/master/deployments and move the files to deployments/docker/mita-amd64 directory.

@@ -0,0 +1,16 @@
services:
meiru:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service, image and container_name should be mita


RUN go mod tidy

RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GOCC=musl-gcc go build -ldflags="-s -w" -o mita cmd/mita/mita.go
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GOCC=musl-gcc have no effect and should be removed, because we have CGO_ENABLED=0, which means there is no C compiler needed and C library linked. Please help to check if the program still runs after it is removed.


WORKDIR /build

RUN go mod tidy
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is not needed. The source code already guarantees the modules are tidy.

@enfein enfein merged commit eb103c3 into enfein:main Oct 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants